package com.example.service.impl;

import com.example.dao.UsersDao;
import com.example.pojo.Student;
import com.example.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UsersServiceImpl implements UsersService {

    @Autowired
    private UsersDao usersDao;

    @Override
    public List<Student> findAll() {
        return usersDao.selectList(null);
    }

    @Override
    public void add(Student student) {
        usersDao.insert(student);
    }

    @Override
    public Student findById(String id) {
        return usersDao.selectById(id);
    }

    @Override
    public void updates(Student student) {
        usersDao.updateById(student);
    }

    @Override
    public void delete(String id) {
        usersDao.deleteById(id);
    }
}
